﻿using System;

namespace fluentvaly.Exceptions
{
    [Serializable]
    public class ValidationNotDefinedException : Exception
    {
        public Type MissingValidationType { get; private set; }

        public ValidationNotDefinedException(Type missingValidationType) : base(CreateErrorMessage(missingValidationType))
        {
            MissingValidationType = missingValidationType;
        }

        private static string CreateErrorMessage(Type missingValidationType)
        {
            return string.Format("Validation not defined for type {0}", missingValidationType.FullName);
        }
    }
}
